class Solution {
    public boolean isUnique(String astr) {
        if(astr.length() > 26) return false;
        char[] arr = astr.toCharArray();
        int hash = 0;
        for(int i = 0 ; i < arr.length ; i++){
            int index = arr[i] - 'a';
            //判断index bit上是不是1
            if(((hash >> index) & 1) == 1) return false;
            hash = hash | (1 << index);
        }
        return true;
    }
}
